package com.example.lib_car

import com.example.lib_car.applyparking.*
import com.example.lib_common.mvi.ResponseEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import java.util.*

interface ApiService {
//  全部车位
    @POST("sysParking/selParking")
    fun requestAllSpace() : Flow<ResponseEntity<List<ParkingEntity>>>
//  请求车位
    @POST("sysParking/applyParking")
    fun requestCommitParking(@Body body: RequestBody) : Flow<ResponseEntity<CarEntity>>
//  所有颜色
    @POST("sysColor/selColor")
    fun requestCarColor() : Flow<ResponseEntity<List<ColorEntity>>>
//    所在部门
    @POST("sysDepartment/selMyDepartment")
    fun requestBelong(@Body body: RequestBody) : Flow<ResponseEntity<List<DepartmentEntity>>>
//  添加车辆
    @POST("sysCar/addCar")
    fun requestAddCar(@Body body: RequestBody) : Flow<ResponseEntity<AddCarEntity>>

//    @Multipart
//    @POST("fileUpload")
//    fun uploadIms(@Part list: List<MultipartBody.Part?>?): Observable<UploadImgsEntity?>

    @Multipart
    @POST("fileUpload")
    fun uploadIms(@Part list: List<MultipartBody.Part>):Flow<ResponseEntity<UpLoadImgEntity>>


}